new Vue({
    el: ".container",
    data: {
        product: {},
        goodsPage: {}
    },
    methods: {
        findPage: function (pageNum) {
            axios({
                url: `/goods/findProduct/${pageNum}/${this.product.id}`
            }).then(res => {
                if (res.data.flag) {
                    this.goodsPage = res.data.data;
                }
            })
        },
        toDetail: function (goodsId) {
            sessionStorage.setItem("goodsId",goodsId);
            location.href = "goodsDetail.html"
        }
    },
    created: function () {
        this.product = JSON.parse(sessionStorage.getItem("product"));
        this.findPage(1);
    }
})